home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / psion / resource.fmt < prev    next >
Text File  |  1995-03-31  |  1KB  |  36 lines

  1. PSIONICS FILE - RESOURCE.FMT
  2. ============================
  3. Format of Resource files
  4. Last modified 1994-03-28
  5. ========================
  6.  
  7. Resource files are uses to hold information for a program which does not
  8. need to be held in the program itself. Two reasons for doing this are:
  9. - the contents of the resource file do not take up process memory when
  10.   not being used;
  11. - the resource file can be changed on a per-language basis without changing
  12.   the rest of the program.
  13.  
  14. A resource file may be standard or compressed. This description only applies
  15. to standard files. The format of a standard file is:
  16.  
  17.   Offset  0 (word): offset of index table
  18.   Offset  2 (word): length in bytes of index table
  19.  
  20. The index table is an array of words, giving the offsets of each resource in
  21. order. By convention resources are numbered from 1 upwards. If the table holds
  22. T entries, there are T-1 resources (1 to T-1); entry N is the offset of the
  23. end of resource N-1 as well as the offset of resource N, and entry T is the
  24. offset of resource T-1, and so should equal offset 0 of the file.
  25.  
  26. For example, if a resource file contains two resources of length A and B
  27. respectively, the file contains:
  28.  
  29.     Offset 0 (word)    : A+B+4
  30.     Offset 2 (word)    : 6
  31.     Offset 4 to A+3    : value of resource 1
  32.     Offset A+4 to A+B+3: value of resource 2
  33.     Offset A+B+4 (word): 4
  34.     Offset A+B+6 (word): A+4
  35.     Offset A+B+8 (word): A+B+4
  36.